package com.example.service.aidl;

import android.os.Binder;
import android.os.IInterface;
import android.os.RemoteException;

public interface IOnBookListener extends IInterface {

    void NewBookArrived(Book book) throws RemoteException;//新书到达通知回调

    public static abstract class Stub extends Binder implements IOnBookListener {

        private static final java.lang.String DESCRIPTOR = "IOnBookListener";

        public static IOnBookListener asInterface(android.os.IBinder obj) {
            if ((obj == null)) {
                return null;
            }
            android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
            if (((iin != null) && (iin instanceof IOnBookListener))) {
                return ((IOnBookListener) iin);
            }
            return new IOnBookListener.Stub.Proxy(obj);
        }

        private static class Proxy implements IOnBookListener {

            private android.os.IBinder mRemote;

            Proxy(android.os.IBinder remote) {
                mRemote = remote;
            }

            @Override
            public android.os.IBinder asBinder() {
                return mRemote;
            }

            public java.lang.String getInterfaceDescriptor() {
                return DESCRIPTOR;
            }

            @Override
            public void NewBookArrived(Book book) throws android.os.RemoteException {
                android.os.Parcel _data = android.os.Parcel.obtain();
                android.os.Parcel _reply = android.os.Parcel.obtain();
                try {
                    _data.writeInterfaceToken(DESCRIPTOR);
                    if ((book != null)) {
                        _data.writeInt(1);
                        book.writeToParcel(_data, 0);
                    } else {
                        _data.writeInt(0);
                    }
                    boolean _status = mRemote.transact(Stub.TRANSACTION_NewBookArrived, _data, _reply, 0);
                    if (!_status && getDefaultImpl() != null) {
                        getDefaultImpl().NewBookArrived(book);
                        return;
                    }
                    _reply.readException();
                } finally {
                    _reply.recycle();
                    _data.recycle();
                }
            }

            public static IOnBookListener sDefaultImpl;
        }

        public static IOnBookListener getDefaultImpl() {
            return Stub.Proxy.sDefaultImpl;
        }
    }

    static final int TRANSACTION_NewBookArrived = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
}
